<?php

namespace Xin\EasyQueue\Hyperf;

use Hyperf\AsyncQueue\Process\ConsumerProcess as HyperfConsumerProcess;
use function Hyperf\Support\env;

class ConsumerProcess extends HyperfConsumerProcess
{
    /**
     * @inheritDoc
     */
    public function isEnable($server): bool
    {
        $queueUpperName = strtoupper($this->queue);

        return env('BOOT_QUEUE', false) && env('BOOT_' . $queueUpperName . '_QUEUE', true) && parent::isEnable($server);
    }
}
